<!--
 * @文件作用:自定义全局loading组件
 * 导入 loading.js   打开=load.show();  关闭=load.hide();
-->
<template>
  <div v-show="props.msg.show" class="loading">
    <div class="load-container">
      <div class="container-1 container">
        <div class="dot dot-1"></div>
        <div class="dot dot-2"></div>
        <div class="dot dot-3"></div>
        <div class="dot dot-4"></div>
      </div>
      <div class="container-2 container">
        <div class="dot dot-1"></div>
        <div class="dot dot-2"></div>
        <div class="dot dot-3"></div>
        <div class="dot dot-4"></div>
      </div>
      <div class="container-3 container">
        <div class="dot dot-1"></div>
        <div class="dot dot-2"></div>
        <div class="dot dot-3"></div>
        <div class="dot dot-4"></div>
      </div>
      <p>{{ props.msg.title }}</p>
    </div>
  </div>
</template>

<script setup>
const props = defineProps({
  msg: {
    type: Object,
  },
  aaa: {
    type: Number,
  },
});
</script>
<style scoped lang="scss">
.loading {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  background-color: rgba(247, 244, 244, 0.2);
  .load-container {
    position: relative;
    width: 48px;
    height: 48px;
    text-align: center;
  }
  p {
    position: absolute;
    top: 57px;
    right: -75px;
    width: 212px;
    color: #387dfb;
    text-align: center;
  }
  .load-container .container {
    position: absolute;
    width: 100%;
    height: 100%;
    text-align: center;
  }
  .load-container .container .dot {
    position: absolute;
    width: 12px;
    height: 12px;
    background-color: #387dfb;
    border-radius: 100%;
    -webkit-animation: bouncedelay 1.2s infinite ease-in-out;
    animation: bouncedelay 1.2s infinite ease-in-out;
    -webkit-animation-fill-mode: both;
    animation-fill-mode: both;
  }
  .load-container .container .dot-1 {
    top: 0;
    left: 0;
  }
  .load-container .container .dot-2 {
    top: 0;
    right: 0;
  }
  .load-container .container .dot-3 {
    right: 0;
    bottom: 0;
  }
  .load-container .container .dot-4 {
    bottom: 0;
    left: 0;
  }
  .load-container .container-1 .dot-2 {
    -webkit-animation-delay: -0.9s;
    animation-delay: -0.9s;
  }
  .load-container .container-1 .dot-3 {
    -webkit-animation-delay: -0.6s;
    animation-delay: -0.6s;
  }
  .load-container .container-1 .dot-4 {
    -webkit-animation-delay: -0.3s;
    animation-delay: -0.3s;
  }
  .load-container .container-2 {
    -webkit-transform: rotateZ(45deg);
    transform: rotateZ(45deg);
  }
  .load-container .container-2 .dot-1 {
    -webkit-animation-delay: -1.1s;
    animation-delay: -1.1s;
  }
  .load-container .container-2 .dot-2 {
    -webkit-animation-delay: -0.8s;
    animation-delay: -0.8s;
  }
  .load-container .container-2 .dot-3 {
    -webkit-animation-delay: -0.5s;
    animation-delay: -0.5s;
  }
  .load-container .container-2 .dot-4 {
    -webkit-animation-delay: -0.2s;
    animation-delay: -0.2s;
  }
  .load-container .container-3 {
    -webkit-transform: rotateZ(90deg);
    transform: rotateZ(90deg);
  }
  .load-container .container-3 .dot-1 {
    -webkit-animation-delay: -1s;
    animation-delay: -1s;
  }
  .load-container .container-3 .dot-2 {
    -webkit-animation-delay: -0.7s;
    animation-delay: -0.7s;
  }
  .load-container .container-3 .dot-3 {
    -webkit-animation-delay: -0.4s;
    animation-delay: -0.4s;
  }
  .load-container .container-3 .dot-4 {
    -webkit-animation-delay: -0.1s;
    animation-delay: -0.1s;
  }

  @-webkit-keyframes bouncedelay {
    0%,
    80%,
    100% {
      -webkit-transform: scale(0);
    }
    40% {
      -webkit-transform: scale(1);
    }
  }
  @keyframes bouncedelay {
    0%,
    80%,
    100% {
      -webkit-transform: scale(0);
      transform: scale(0);
    }
    40% {
      -webkit-transform: scale(1);
      transform: scale(1);
    }
  }
}
</style>
